<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>LCV Framework: test-gpio.c Quellcode</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Erzeugt von Doxygen 1.5.3 -->
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Hauptseite</span></a></li>
    <li><a href="classes.html"><span>Datenstrukturen</span></a></li>
    <li class="current"><a href="files.html"><span>Dateien</span></a></li>
  </ul>
</div>
<h1>test-gpio.c</h1><a href="test-gpio_8c.html">gehe zur Dokumentation dieser Datei</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#include &lt;stdio.h&gt;</span>
<a name="l00002"></a>00002 <span class="preprocessor">#include "<a class="code" href="gpio_8h.html" title="Definiert die abstrakte Schnittstelle zu den GPIO Ports.">lcv/gpio.h</a>"</span>
<a name="l00003"></a>00003 
<a name="l00004"></a><a class="code" href="test-gpio_8c.html#ebaa6e302192c92d3473ad844deac2e6">00004</a> <span class="preprocessor">#define OUT_1_PROBLEM</span>
<a name="l00005"></a>00005 <span class="preprocessor"></span>
<a name="l00006"></a><a class="code" href="test-gpio_8h.html#4104d17b035a4a49b354a01fbef44286">00006</a> <span class="keywordtype">void</span> <a class="code" href="test-gpio_8c.html#4104d17b035a4a49b354a01fbef44286" title="Testet die gpio library des LCV-Frameworks.">test_gpio</a>()
<a name="l00007"></a>00007 {
<a name="l00008"></a>00008         printf(<span class="stringliteral">"reading port IN_0: %x\n"</span>, <a class="code" href="gpio-linux32_8c.html#3c849148710bb60896fc1d15213b3c47" title="Liest den Wert eines Eingabeports.">lcv_port_read</a>(<a class="code" href="lcv-config_8h.html#97959e97eac8414a33f62b57909dafd1" title="In-Ports.">IN_0</a>));
<a name="l00009"></a>00009         printf(<span class="stringliteral">"reading port IN_1: %x\n"</span>, <a class="code" href="gpio-linux32_8c.html#3c849148710bb60896fc1d15213b3c47" title="Liest den Wert eines Eingabeports.">lcv_port_read</a>(<a class="code" href="lcv-config_8h.html#9f96581595ba16bf7696cde741877e1a">IN_1</a>));
<a name="l00010"></a>00010         
<a name="l00011"></a>00011         printf(<span class="stringliteral">"writing 1 to port OUT_0\n"</span>);
<a name="l00012"></a>00012         <span class="keywordflow">if</span>(<a class="code" href="gpio-linux32_8c.html#5362148a65cf8654b773a4808465f1db" title="Schreibt den Wert eines Ausgabeports.">lcv_port_write</a>(<a class="code" href="lcv-config_8h.html#3506e2878e0f36c5dffd515e6b386c5e" title="Out-Ports.">OUT_0</a>, 1) &lt; 0) {
<a name="l00013"></a>00013                 printf(<span class="stringliteral">"error detected\n"</span>);
<a name="l00014"></a>00014         }
<a name="l00015"></a>00015         printf(<span class="stringliteral">"writing 0 to port OUT_0\n"</span>);
<a name="l00016"></a>00016         <span class="keywordflow">if</span>(<a class="code" href="gpio-linux32_8c.html#5362148a65cf8654b773a4808465f1db" title="Schreibt den Wert eines Ausgabeports.">lcv_port_write</a>(<a class="code" href="lcv-config_8h.html#3506e2878e0f36c5dffd515e6b386c5e" title="Out-Ports.">OUT_0</a>, 0) &lt; 0) {
<a name="l00017"></a>00017                 printf(<span class="stringliteral">"error detected\n"</span>);
<a name="l00018"></a>00018         }
<a name="l00019"></a>00019 <span class="preprocessor">        #ifndef OUT_1_PROBLEM</span>
<a name="l00020"></a>00020 <span class="preprocessor"></span>                printf(<span class="stringliteral">"writing 1 to port OUT_1\n"</span>);
<a name="l00021"></a>00021                 <span class="keywordflow">if</span>(<a class="code" href="gpio-linux32_8c.html#5362148a65cf8654b773a4808465f1db" title="Schreibt den Wert eines Ausgabeports.">lcv_port_write</a>(<a class="code" href="lcv-config_8h.html#69935f16da7c62437bf70a37e61c3be4">OUT_1</a>, 1) &lt; 0) {
<a name="l00022"></a>00022                         printf(<span class="stringliteral">"error detected\n"</span>);
<a name="l00023"></a>00023                 }
<a name="l00024"></a>00024                 printf(<span class="stringliteral">"writing 0 to port OUT_1\n"</span>);
<a name="l00025"></a>00025                 <span class="keywordflow">if</span>(<a class="code" href="gpio-linux32_8c.html#5362148a65cf8654b773a4808465f1db" title="Schreibt den Wert eines Ausgabeports.">lcv_port_write</a>(<a class="code" href="lcv-config_8h.html#69935f16da7c62437bf70a37e61c3be4">OUT_1</a>, 0) &lt; 0) {
<a name="l00026"></a>00026                         printf(<span class="stringliteral">"error detected\n"</span>);
<a name="l00027"></a>00027                 }
<a name="l00028"></a>00028 <span class="preprocessor">        #endif</span>
<a name="l00029"></a>00029 <span class="preprocessor"></span>}
</pre></div><hr size="1"><address style="text-align: right;"><small>Erzeugt am Thu Dec 13 14:01:49 2007 für LCV Framework von&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.3 </small></address>
</body>
</html>
